package com.codeduck.kafka.consumer;

import com.codeduck.kafka.consumer.thread.SubscribeMsgRunnable;
import com.codeduck.pojo.TopicHandler;
import org.apache.kafka.common.TopicPartition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;
import java.util.Properties;

/**
 * @author: <a href="mailto:codeduck@163.com">Codeduck</a>
 * @date: 2023/3/4
 */
@Component
@Scope(value = "prototype")
public class KafkaMessageConsumer implements IMessageConsumer {


    @Override
    public void subscribe(Properties properties, TopicHandler topicHandler) {
        new Thread(new SubscribeMsgRunnable(properties, topicHandler)).start();
    }

    @Override
    public void subscribe(Properties properties, List<String> topics) {

    }

    @Override
    public void assign(Properties properties, List<TopicPartition> topicPartitions) {

    }
}
